package com.bustle.order.dto.account;

import javax.ejb.EJB;
import javax.ejb.Local;
import javax.ejb.Stateless;

import com.bustle.commons.MapConverter;
import com.bustle.commons.data.dao.Dao;
import com.bustle.commons.data.dto.DtoDao;
import com.bustle.order.data.Account;
import com.bustle.order.data.dao.AccountDao;

@Local
public interface AccountDtoDao extends Dao<Integer, AccountDto>
{
  @Stateless
  public class DefaultAccountDtoDao extends DtoDao<Integer, AccountDto, Account> implements AccountDtoDao
  {
    @Override
    protected Dao<Integer, Account> getDao()
    {
      return dao;
    }

    @Override
    protected MapConverter<AccountDto, Account> getDtoToDataMapConverter()
    {
      return dtoToAccountConverter;
    }

    @Override
    protected MapConverter<Account, AccountDto> getDataToDtoMapConverter()
    {
      return accountToDtoConverter;
    }

    @EJB
    protected AccountDao dao;
    @EJB
    protected DtoToAccountMapConverter dtoToAccountConverter;
    @EJB
    protected AccountToDtoMapConverter accountToDtoConverter;
  }
}
